<template>
  <div>
    <secondary-title v-if="formData.title">
      {{ formData.title }}
    </secondary-title>
    <a-row>
      <a-col
        :span="item.colSpan"
        v-for="(item, idx) in formData.formList"
        :key="idx"
      >
        <template v-if="item.formType">
          <component
            :is="item.formType"
            :attrObj="{ ...item }"
            :formModel="formModel"
          />
        </template>
        <slot :name="item.slotName" v-else></slot>
      </a-col>
    </a-row>
  </div>
</template>

<script>
import {
  FormDatepicker,
  FormInput,
  FormSelect,
  UploadImg
} from "./formComponent";
import { SecondaryTitle } from '../common';
export default {
  name: "FormPanel",
  props: {
    formModel: {
      type: Object,
      default() {
        return {};
      }
    },
    formData: {
      type: Object,
      default() {
        return {
          title: '',
          formList: []
        }
      }
    }
  },
  data() {
    return {
    };
  },
  components: {
    FormDatepicker,
    FormInput,
    FormSelect,
    UploadImg,
    SecondaryTitle
  },
  watch: {},
  mounted() {},
  computed: {},
  methods: {}
};
</script>
